﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Ord3a00
    {
		private string _docno;
		private string _olistid;
		private string _backno;
		private string _comcode;
		private string _comname;
		private string _selldocno;
		private string _sellerid;
		private string _splistid;
        private DateTime? _createdate;
        private DateTime? _bookdate;
        private int? _tranday;
        private DateTime? _reqdate;
        private DateTime? _backdate;
        private int? _status;
		private string _tlistid;
		private double _ordamt;
		private double _accamt;
		private double _sendamt;
		private double _gainamt;
		private double _gainpct;
		private double _dutyamt;
		private double _usept;
		private string _traffid;
        private int? _audstatus;
		private string _storageid;
		private string _remark;
		private double _agioamt;
		private string _accremark;
		private string _muser;
		private string _listid;
		private string _utext1;
		private string _utext2;
		private string _canedit;
		private double _adjtotalqty;
		private double _adjtotalamt;
		
        /// <summary>
        /// 订单编号
        /// </summary>
		public string Docno
		{
			get { return _docno;	 }
			set { _docno=value;	}
		}
        /// <summary>
        /// 订单类型主键
        /// </summary>
		public string Olistid
		{
			get { return _olistid;	 }
			set { _olistid=value;	}
		}
        /// <summary>
        /// 回单号码
        /// </summary>
		public string Backno
		{
			get { return _backno;	 }
			set { _backno=value;	}
		}
        /// <summary>
        /// 公司代码
        /// </summary>
		public string Comcode
		{
			get { return _comcode;	 }
			set { _comcode=value;	}
		}
        /// <summary>
        /// 公司名称
        /// </summary>
		public string Comname
		{
			get { return _comname;	 }
			set { _comname=value;	}
		}
        /// <summary>
        /// 销售商订单号
        /// </summary>
		public string Selldocno
		{
			get { return _selldocno;	 }
			set { _selldocno=value;	}
		}
        /// <summary>
        /// 销售商主键
        /// </summary>
		public string Sellerid
		{
			get { return _sellerid;	 }
			set { _sellerid=value;	}
		}
        /// <summary>
        /// 门店主键
        /// </summary>
		public string Splistid
		{
			get { return _splistid;	 }
			set { _splistid=value;	}
		}
        /// <summary>
        /// 订单创建日期
        /// </summary>
		public DateTime? Createdate
		{
			get { return _createdate;	 }
			set { _createdate=value;	}
		}
        /// <summary>
        /// 订货日期
        /// </summary>
		public DateTime? Bookdate
		{
			get { return _bookdate;	 }
			set { _bookdate=value;	}
		}
        /// <summary>
        /// 送货天数
        /// </summary>
		public int? Tranday
		{
			get { return _tranday;	 }
			set { _tranday=value;	}
		}
        /// <summary>
        /// 应送货日期
        /// </summary>
		public DateTime? Reqdate
		{
			get { return _reqdate;	 }
			set { _reqdate=value;	}
		}
        /// <summary>
        /// 实际出货日期
        /// </summary>
		public DateTime? Backdate
		{
			get { return _backdate;	 }
			set { _backdate=value;	}
		}
        /// <summary>
        /// 订单状态
        /// </summary>
		public int? Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 送货地址标识
        /// </summary>
		public string Tlistid
		{
			get { return _tlistid;	 }
			set { _tlistid=value;	}
		}
        /// <summary>
        /// 订货总额
        /// </summary>
		public double Ordamt
		{
			get { return _ordamt;	 }
			set { _ordamt=value;	}
		}
        /// <summary>
        /// 收货总额
        /// </summary>
		public double Accamt
		{
			get { return _accamt;	 }
			set { _accamt=value;	}
		}
        /// <summary>
        /// 配送总额
        /// </summary>
		public double Sendamt
		{
			get { return _sendamt;	 }
			set { _sendamt=value;	}
		}
        /// <summary>
        /// 毛利总额
        /// </summary>
		public double Gainamt
		{
			get { return _gainamt;	 }
			set { _gainamt=value;	}
		}
        /// <summary>
        /// 毛利率
        /// </summary>
		public double Gainpct
		{
			get { return _gainpct;	 }
			set { _gainpct=value;	}
		}
        /// <summary>
        /// 税额
        /// </summary>
		public double Dutyamt
		{
			get { return _dutyamt;	 }
			set { _dutyamt=value;	}
		}
        /// <summary>
        /// 使用量
        /// </summary>
		public double Usept
		{
			get { return _usept;	 }
			set { _usept=value;	}
		}
        /// <summary>
        /// 物流公司标识
        /// </summary>
		public string Traffid
		{
			get { return _traffid;	 }
			set { _traffid=value;	}
		}
        /// <summary>
        /// 订单审核状态
        /// </summary>
		public int? Audstatus
		{
			get { return _audstatus;	 }
			set { _audstatus=value;	}
		}
        /// <summary>
        /// 发货仓库
        /// </summary>
		public string Storageid
		{
			get { return _storageid;	 }
			set { _storageid=value;	}
		}
        /// <summary>
        /// 订单备注
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
        /// <summary>
        /// 总的折扣金额
        /// </summary>
		public double Agioamt
		{
			get { return _agioamt;	 }
			set { _agioamt=value;	}
		}
        /// <summary>
        /// 收货备注
        /// </summary>
		public string Accremark
		{
			get { return _accremark;	 }
			set { _accremark=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Utext1
		{
			get { return _utext1;	 }
			set { _utext1=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Utext2
		{
			get { return _utext2;	 }
			set { _utext2=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Canedit
		{
			get { return _canedit;	 }
			set { _canedit=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Adjtotalqty
		{
			get { return _adjtotalqty;	 }
			set { _adjtotalqty=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Adjtotalamt
		{
			get { return _adjtotalamt;	 }
			set { _adjtotalamt=value;	}
		}
		
		public static List<Ord3a00> GetOrd3a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Ord3a00> list = new List<Ord3a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Ord3a00 model = GetOrd3a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Ord3a00 GetOrd3a00ByDataRow(DataRow dr)
		{
			Ord3a00 model = new Ord3a00(); //实例化Ord3a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("docno")&&!(dr["docno"] is System.DBNull))  
				model.Docno = ( string)dr["docno"];
			if (dcc.Contains("olistid")&&!(dr["olistid"] is System.DBNull))  
				model.Olistid = ( string)dr["olistid"];
			if (dcc.Contains("backno")&&!(dr["backno"] is System.DBNull))  
				model.Backno = ( string)dr["backno"];
			if (dcc.Contains("comcode")&&!(dr["comcode"] is System.DBNull))  
				model.Comcode = ( string)dr["comcode"];
			if (dcc.Contains("comname")&&!(dr["comname"] is System.DBNull))  
				model.Comname = ( string)dr["comname"];
			if (dcc.Contains("selldocno")&&!(dr["selldocno"] is System.DBNull))  
				model.Selldocno = ( string)dr["selldocno"];
			if (dcc.Contains("sellerid")&&!(dr["sellerid"] is System.DBNull))  
				model.Sellerid = ( string)dr["sellerid"];
			if (dcc.Contains("splistid")&&!(dr["splistid"] is System.DBNull))  
				model.Splistid = ( string)dr["splistid"];
			if (dcc.Contains("createdate")&&!(dr["createdate"] is System.DBNull))  
				model.Createdate = ( DateTime)dr["createdate"];
			if (dcc.Contains("bookdate")&&!(dr["bookdate"] is System.DBNull))  
				model.Bookdate = ( DateTime)dr["bookdate"];
			if (dcc.Contains("tranday")&&!(dr["tranday"] is System.DBNull))  
				model.Tranday = ( int)dr["tranday"];
			if (dcc.Contains("reqdate")&&!(dr["reqdate"] is System.DBNull))  
				model.Reqdate = ( DateTime)dr["reqdate"];
			if (dcc.Contains("backdate")&&!(dr["backdate"] is System.DBNull))  
				model.Backdate = ( DateTime)dr["backdate"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( int)dr["status"];
			if (dcc.Contains("tlistid")&&!(dr["tlistid"] is System.DBNull))  
				model.Tlistid = ( string)dr["tlistid"];
			if (dcc.Contains("ordamt")&&!(dr["ordamt"] is System.DBNull))  
				model.Ordamt = Convert.ToDouble(dr["ordamt"]);
			if (dcc.Contains("accamt")&&!(dr["accamt"] is System.DBNull))  
				model.Accamt = Convert.ToDouble(dr["accamt"]);
			if (dcc.Contains("sendamt")&&!(dr["sendamt"] is System.DBNull))  
				model.Sendamt = Convert.ToDouble(dr["sendamt"]);
			if (dcc.Contains("gainamt")&&!(dr["gainamt"] is System.DBNull))  
				model.Gainamt = Convert.ToDouble(dr["gainamt"]);
			if (dcc.Contains("gainpct")&&!(dr["gainpct"] is System.DBNull))  
				model.Gainpct = Convert.ToDouble(dr["gainpct"]);
			if (dcc.Contains("dutyamt")&&!(dr["dutyamt"] is System.DBNull))  
				model.Dutyamt = Convert.ToDouble(dr["dutyamt"]);
			if (dcc.Contains("usept")&&!(dr["usept"] is System.DBNull))  
				model.Usept = Convert.ToDouble(dr["usept"]);
			if (dcc.Contains("traffid")&&!(dr["traffid"] is System.DBNull))  
				model.Traffid = ( string)dr["traffid"];
			if (dcc.Contains("audstatus")&&!(dr["audstatus"] is System.DBNull))  
				model.Audstatus = ( int)dr["audstatus"];
			if (dcc.Contains("storageid")&&!(dr["storageid"] is System.DBNull))  
				model.Storageid = ( string)dr["storageid"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			if (dcc.Contains("agioamt")&&!(dr["agioamt"] is System.DBNull))  
				model.Agioamt = Convert.ToDouble(dr["agioamt"]);
			if (dcc.Contains("accremark")&&!(dr["accremark"] is System.DBNull))  
				model.Accremark = ( string)dr["accremark"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("utext1")&&!(dr["utext1"] is System.DBNull))  
				model.Utext1 = ( string)dr["utext1"];
			if (dcc.Contains("utext2")&&!(dr["utext2"] is System.DBNull))  
				model.Utext2 = ( string)dr["utext2"];
			if (dcc.Contains("canedit")&&!(dr["canedit"] is System.DBNull))  
				model.Canedit = ( string)dr["canedit"];
			if (dcc.Contains("adjtotalqty")&&!(dr["adjtotalqty"] is System.DBNull))  
				model.Adjtotalqty = Convert.ToDouble(dr["adjtotalqty"]);
			if (dcc.Contains("adjtotalamt")&&!(dr["adjtotalamt"] is System.DBNull))  
				model.Adjtotalamt = Convert.ToDouble(dr["adjtotalamt"]);
			
			return model;
		}
    }
}
